package cn.tedu.review;
/*本类用于回顾继承*/
public class TestExtends {
    public static void main(String[] args) {
        ComputerStudent s1=new ComputerStudent(1,"汤姆",'男',50);
        MathStudent s2=new MathStudent(2,"杰克",'男',80);
        ChineseStudent s3=new ChineseStudent(3,"露丝",'女',100);

        s1.proClass();
        s1.hobby();
        s2.proClass();
        s2.hobby();
        s3.proClass();
        s3.hobby();

        Student s=new Student(4,"海绵宝宝",'男',100);
    s.thinkingClass();
    s.proClass();
    }
}
class  Student{
    int sno;
    String name;
    char gender;
    double score;

    public void thinkingClass(){
        System.out.println("正在上思修课");
    }
    public void proClass(){
        System.out.println("正在上专业课");
    }

    public Student(int sno, String name, char gender, double score) {
        this.sno = sno;
        this.name = name;
        this.gender = gender;
        this.score = score;
    }
}

class ComputerStudent extends Student{
    public ComputerStudent(int sno, String name, char gender, double score) {
        super(sno, name, gender, score);
    }

    @Override
    public void proClass(){
        System.out.println("正在上编程课");
    }
    public void hobby(){
        System.out.println("喜欢敲代码");
    }
}

class MathStudent extends Student{
    public MathStudent(int sno, String name, char gender, double score) {
        super(sno, name, gender, score);
    }

    @Override
    public void proClass(){
        System.out.println("正在上数学理论课");
    }
    public void hobby(){
        System.out.println("喜欢模糊数学");
    }
}
class ChineseStudent extends Student{
    public ChineseStudent(int sno, String name, char gender, double score) {
        super(sno, name, gender, score);
    }

    @Override
    public void proClass(){
        System.out.println("正在上写作课");
    }
    public void hobby(){
        System.out.println("喜欢写小说");
    }
}